<?php
/**
 * Category.php
 *
 * @category    Madoqua
 * @package     Module
 * @subpackage  BlogAdmin
 */

/** base class */
require_once 'Madoqua/Form.php';

/** html entities filter */
require_once 'Zend/Filter/HtmlEntities.php';

/**
 * BlogAdmin_Category_Category
 *
 * @category    Madoqua
 * @package     Module
 * @subpackage  BlogAdmin
 */
class BlogAdmin_Category_Category extends Madoqua_Form
{
    /**
     * no html filter
     *
     * @var Zend_Filter_HtmlEntities
     */
    protected $_noHtml;

    /**
     * constructor
     */
    public function __construct() {
        parent::__construct();

        $this->_noHtml = new Zend_Filter_HtmlEntities(array(
                'quotestyle' => ENT_COMPAT,
                'charset'    => 'UTF-8'
            )
        );
        //htmlentities filter for non-html fields

        $this->addElement('text', 'name', array(
            'label' => 'Title',
            'required' => true,
            'validators' => array(
                array('stringLength', false, array(3, 255))
            ),
            'filters' => array(
                $this->_noHtml
            )
        ));
        //name for the category

        $this->addElement('textarea', 'description', array(
            'label' => 'Description',
            'required' => true,
            'validators' => array(
            ),
            'filters' => array(
                $this->_noHtml
            )
        ));
        //description
        $this->addElement('submit', 's', array(
            'label' => 'Submit'
        ));
    }
}